package com.longge.wechat.entity;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

@Table(name = "shop", schema = "", catalog = "travel")
@Entity
public class ShopEntity {

	private Integer id;
	private String path;// 商铺图片路径
	private String name;// 商铺名称
	private String address;// 商铺地址
	private String tel;// 商铺联系电话
	private Date addTime;// 添加时间
	private Integer priority;// 优先级（标记商铺优先显示次序）
	private String hours;// 商铺营业时间
	
	
	public ShopEntity() {}

	public ShopEntity(Integer id, String path, String name, String address,
			String tel, Date addTime, Integer priority,String hours) {
		super();
		this.id = id;
		this.path = path;
		this.name = name;
		this.address = address;
		this.tel = tel;
		this.addTime = addTime;
		this.priority = priority;
		this.hours = hours;
	}

	@Column(name = "id", nullable = false, insertable = true, updatable = true, length = 11, precision = 0)
	@Id
	// 自增的id，主键
	@GeneratedValue
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	
	@Column(name = "path", nullable = true, insertable = true, updatable = true, length = 1024, precision = 0)
	@Basic
	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	@Column(name = "addTime", nullable = true, insertable = true, updatable = true, length = 20, precision = 0)
	@Basic
	public Date getAddTime() {
		return addTime;
	}

	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}

	@Column(name = "name", nullable = true, insertable = true, updatable = true, length = 50, precision = 0)
	@Basic
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "address", nullable = true, insertable = true, updatable = true, length = 500, precision = 0)
	@Basic
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "tel", nullable = true, insertable = true, updatable = true, length = 11, precision = 0)
	@Basic
	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	@Column(name = "priority", nullable = true, insertable = true, updatable = true, length = 5, precision = 0)
	@Basic
	public Integer getPriority() {
		return priority;
	}

	public void setPriority(Integer priority) {
		this.priority = priority;
	}

	@Column(name = "hours", nullable = true, insertable = true, updatable = true, length = 50, precision = 0)
	@Basic
	public String getHours() {
		return hours;
	}

	public void setHours(String hours) {
		this.hours = hours;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((path == null) ? 0 : path.hashCode());
		result = prime * result + ((address == null) ? 0 : address.hashCode());
		result = prime * result + ((tel == null) ? 0 : tel.hashCode());
		result = prime * result + ((addTime == null) ? 0 : addTime.hashCode());
		result = prime * result + ((priority == null) ? 0 : priority.hashCode());
		result = prime * result + ((hours == null) ? 0 : hours.hashCode());
		return result;
	}

	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ShopEntity other = (ShopEntity) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (path == null) {
			if (other.path != null)
				return false;
		} else if (!path.equals(other.path))
			return false;
		if (address == null) {
			if (other.address != null)
				return false;
		} else if (!address.equals(other.address))
			return false;
		if (tel == null) {
			if (other.tel != null)
				return false;
		} else if (!tel.equals(other.tel))
			return false;
		if (addTime == null) {
			if (other.addTime != null)
				return false;
		} else if (!addTime.equals(addTime))
			return false;
		if (priority == null) {
			if (other.priority != null)
				return false;
		} else if (!priority.equals(other.priority))
			return false;
		if (hours == null) {
			if (other.hours != null)
				return false;
		} else if (!hours.equals(other.hours))
			return false;
		return true;
	}
}
